<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript">
$(document).ready(function() {
    $('#myTable').dataTable();
} );
</script>
<div style="margin-top: 5px; margin-bottom: 15px">
<h2 style="display: inline"><s:property value="eventBean.eventName" /></h2>
<div style="float: right"><!-- Event bearbeiten --> <s:if
	test="#session.loginToken.rights.contains('event_edit') || eventBean.eventOwner.userId == #session.loginToken.userId">
	<s:url id="editEventUrlId" action="editEventInput" namespace="/">
		<s:param name="eventId">
			<s:property value="eventId"></s:property>
		</s:param>
	</s:url>
	<s:a href="%{editEventUrlId}" title="%{getText('showEvent.editEvent')}">
		<img src="image/icons/0037_notepad.png" width="24" height="24"
			alt="profile" border="0">
	</s:a>
</s:if> <!-- Event löschen --> <s:if
	test="#session.loginToken.rights.contains('event_delete') || eventBean.eventOwner.userId == #session.loginToken.userId">
	<s:url id="deleteEventUrlId" action="deleteEvent" namespace="/">
		<s:param name="eventId">
			<s:property value="eventId"></s:property>
		</s:param>
	</s:url>
	<s:a href="%{deleteEventUrlId}"
		title="%{getText('showEvent.deleteEvent')}">
		<img src="image/icons/0049_trash.png" width="24" height="24"
			alt="delete" border="0" onclick="return ask_first(this);">
	</s:a>
</s:if> <!-- Event abrechnen --> <s:if
	test="#session.loginToken.rights.contains('event_calculate') && eventBean.isActive == true">
	<s:url id="calculateEventUrlId" action="finalSettlement" namespace="/">
		<s:param name="eventId">
			<s:property value="eventId"></s:property>
		</s:param>
	</s:url>
	<s:a href="%{calculateEventUrlId}"
		title="%{getText('showEvent.calculateEvent')}">
		<img src="image/more-icons/clock.gif" width="24" height="24"
			alt="calculate" border="0" onclick="return ask_first(this,'Event wirklich abrechnen?');">
	</s:a>
</s:if> <!-- Event anzeigen --> <s:if
	test="eventBean.isActive == false">
	<s:url id="showCalculateEventUrlId" action="finalSettlementInput" namespace="/">
		<s:param name="eventId">
			<s:property value="eventId"></s:property>
		</s:param>
	</s:url>
	<s:a href="%{showCalculateEventUrlId}"
		title="%{getText('showEvent.calculateEvent')}">
		<img src="image/icons/money.png" width="24" height="24"
			alt="showCalculate" border="0">
	</s:a>
</s:if></div>
</div>
<table class="green">
	<tr>
		<th width="25%"><s:text name="eventBean.eventName"></s:text></th>
		<td><s:property value="eventBean.eventName" /></td>
	</tr>
	<tr>
		<th><s:text name="eventBean.eventDescription"></s:text></th>
		<td><s:property value="eventBean.eventDescription" /></td>
	</tr>
	<tr>
		<th><s:text name="eventBean.eventDate"></s:text></th>
		<td><s:date name="eventBean.eventDate" format="dd.MM.yyyy" /></td>
	</tr>
	<tr>
		<th><s:text name="eventBean.eventLocation"></s:text></th>
		<td><s:property value="eventBean.eventLocation" /></td>
	</tr>
	<tr>
		<th><s:text name="eventBean.eventOwner"></s:text></th>
		<td><s:property value="eventBean.eventOwner.email" /></td>
	</tr>
</table>

<!-- Teilnehmerstatus setzen --> <s:form action="editParticipation"
	theme="simple">
	<s:text name="showEvent.myStatus" />
	<s:select name="participationStatus" list="participationStatusMap"
		onchange="this.form.submit();" value="actUserStatus"></s:select>
	<s:hidden key="eventId"></s:hidden>
</s:form>
<h2><s:text name="showEvent.participants" /></h2>
<table id="myTable" class="green">
	<thead>
		<tr>
			<th><s:text name="userBean.firstName" /></th>
			<th><s:text name="userBean.lastName" /></th>
			<th><s:text name="userBean.email" /></th>
			<th><s:text name="showEvent.status" /></th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="userList">
			<tr>
				<td><s:property value="firstName"></s:property></td>
				<td><s:property value="lastName"></s:property></td>
				<td><s:property value="email"></s:property></td>
				<td><s:property value="status"></s:property></td>
			</tr>
		</s:iterator>
	</tbody>
</table>

<div style="margin-top: 5px; margin-bottom: 15px">
<h2 style="display: inline"><s:text name="showEvent.positions"></s:text></h2>
<div style="float: right"><!-- Positionen anzeigen --> <s:if
	test="#session.loginToken.rights.contains('event_list_positions')">
	<s:url id="listPositionsUrlId" action="listPositions" namespace="/">
		<s:param name="eventId">
			<s:property value="eventId"></s:property>
		</s:param>
	</s:url>
	<s:a href="%{listPositionsUrlId}"
		title="%{getText('showEvent.listPositions')}">
		<img src="image/icons/wallet.png" width="24" height="24" alt="delete"
			border="0">
	</s:a>
</s:if></div>
</div>
<table class="green">
	<tr>
		<th width="25%">Anzahl Positionen</th>
		<td><s:property value="positionCount"></s:property></td>
	</tr>
	<tr>
		<th>Gesamtbetrag</th>
		<td><s:property value="positionSum"></s:property></td>
	</tr>
</table>